package com.reflection;

/**
 * 获取class类对象的三种方法
 */
public class t1_三种方式 {
    public static void main(String[] args) throws Exception {
        //方式1
        Class<?> clazz1 = Class.forName("com.reflection.Student");

        //方式2
        Class<Student> clazz2 = Student.class;

        //方式3
        Student s = new Student();
        Class<? extends Student> clazz3 = s.getClass();

        System.out.println(clazz1);
        System.out.println(clazz2);
        System.out.println(clazz3);
    }
}
